<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function toStr(time) {
            return time+'';//将数字转换为字符串
        }
        function toDouble(n) {
            if(n<10){
                return "0"+n;
            }
            else {
                return n;//小于10的时候返回01,02,03,04，。。。大于10的时候，返回当前数
            }
        }
        function loadTime() {
            var date = new Date();
            var sDate = toStr(toDouble(date.getHours()))+":"+toStr(toDouble(date.getMinutes()))+":"+toStr(toDouble(date.getSeconds()))//时分秒

            var aImgs = document.getElementsByTagName('img');
            for(var i=0;i<aImgs.length;i++){
                if(sDate.charAt(i)!=":"){
                    aImgs[i].src = 'images/'+sDate.charAt(i)+'.JPG';
                }
            }
        }
        window.onload = function () {
            setInterval(function () {
                loadTime();
            },1000);
            loadTime();
        }
    </script>
</head>
<body>
<img src="images/0.JPG" alt="">
<img src="images/0.JPG" alt="">
<img src="images/colon.JPG" alt="">
<img src="images/0.JPG" alt="">
<img src="images/0.JPG" alt="">
<img src="images/colon.JPG" alt="">
<img src="images/0.JPG" alt="">
<img src="images/0.JPG" alt="">
</body>
</html>